package com.ruoyi.web.controller.publish;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.publish.domain.IdAcceptRegister;
import com.ruoyi.publish.domain.statistics.*;
import com.ruoyi.publish.service.IStatisticsService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 鉴定受理登记Controller
 * 
 * @author confusefox
 * @date 2020-11-04
 */
@Controller
@RequestMapping("/statistics")
public class StatisticsController extends BaseController
{
    private String prefix = "publish/statistics";

    @Autowired
    private IStatisticsService statisticsService;






//    样本数量统计
    /**
     * 样本数量统计列表
     */
//    @RequiresPermissions("publish:register:view")
    @GetMapping("RvNumberSample")
    public String RvSampleNumber()
    {
        return prefix + "/RvNumberSample";
    }

    /**
     * 查询样本数量统计列表
     */
//    @RequiresPermissions("publish:register:list")
    @PostMapping("/listRvSampleNumber")
    @ResponseBody
    public TableDataInfo listRvSampleNumber(RvNumberSample rvNumberSample)
    {
        startPage();
        List<RvNumberSample> list = statisticsService.selectRvNumberSampleList(rvNumberSample);
        return getDataTable(list);
    }

    /**
     * 导出样本数量统计列表
     */
//    @RequiresPermissions("publish:register:export")
    @Log(title = "样本数量统计", businessType = BusinessType.EXPORT)
    @PostMapping("/exportRvSampleNumber")
    @ResponseBody
    public AjaxResult exportRvSampleNumber(RvNumberSample rvNumberSample)
    {
        List<RvNumberSample> list = statisticsService.selectRvNumberSampleList(rvNumberSample);
        ExcelUtil<RvNumberSample> util = new ExcelUtil<RvNumberSample>(RvNumberSample.class);
        return util.exportExcel(list, "样本数量统计");
    }


//    样本介质统计
    /**
     * 样本介质统计列表
     */
//    @RequiresPermissions("publish:register:view")
    @GetMapping("RvMediumSample")
    public String RvMediumSampleRegister()
    {
        return prefix + "/RvMediumSample";
    }

    /**
     * 查询样本介质统计列表
     */
//    @RequiresPermissions("publish:register:list")
    @PostMapping("/listRvMediumSample")
    @ResponseBody
    public TableDataInfo listRvMediumSample(RvMediumSample RvMediumSample)
    {
        startPage();
        List<RvMediumSample> list = statisticsService.selectRvMediumSampleList(RvMediumSample);
        return getDataTable(list);
    }

    /**
     * 导出样本介质统计列表
     */
//    @RequiresPermissions("publish:register:export")
    @Log(title = "样本介质统计", businessType = BusinessType.EXPORT)
    @PostMapping("/exportRvMediumSample")
    @ResponseBody
    public AjaxResult exportRvMediumSample(RvMediumSample RvMediumSample)
    {
        List<RvMediumSample> list = statisticsService.selectRvMediumSampleList(RvMediumSample);
        ExcelUtil<RvMediumSample> util = new ExcelUtil<RvMediumSample>(RvMediumSample.class);
        return util.exportExcel(list, "样本介质统计");
    }

    //    稿件介质统计
    /**
     * 样本介质统计列表
     */
//    @RequiresPermissions("publish:register:view")
    @GetMapping("RvMediumReview")
    public String RvMediumReviewRegister()
    {
        return prefix + "/RvMediumReview";
    }

    /**
     * 查询样本介质统计列表
     */
//    @RequiresPermissions("publish:register:list")
    @PostMapping("/listRvMediumReview")
    @ResponseBody
    public TableDataInfo listRvMediumReview(RvMediumReview rvMediumReview)
    {
        startPage();
        List<RvMediumReview> list = statisticsService.selectRvMediumReviewList(rvMediumReview);
        return getDataTable(list);
    }

    /**
     * 导出样本介质统计列表
     */
//    @RequiresPermissions("publish:register:export")
    @Log(title = "样本介质统计", businessType = BusinessType.EXPORT)
    @PostMapping("/exportRvMediumReview")
    @ResponseBody
    public AjaxResult exportRvMediumReview( RvMediumReview rvMediumReview)
    {
        List<RvMediumReview> list = statisticsService.selectRvMediumReviewList(rvMediumReview);
        ExcelUtil<RvMediumReview> util = new ExcelUtil<RvMediumReview>(RvMediumReview.class);
        return util.exportExcel(list, "样本介质统计");
    }


//    鉴定

    /**
     * 样本数量统计 报表页面跳转
     */
//    @RequiresPermissions("publish:register:view")
    @GetMapping("IdSampleNumberAll")
    public String IdSampleNumberAll()
    {
        return prefix + "/IdSampleNumberAll";
    }
//    日
    /**
     * 样本数量统计列表
     */
//    @RequiresPermissions("publish:register:view")
    @GetMapping("IdSampleNumberDay")
    public String IdSampleNumberDay()
    {
        return prefix + "/IdSampleNumberDay";
    }

    /**
     * 样本数量统计列表
     */
//    @RequiresPermissions("publish:register:list")
    @PostMapping("/listIdSampleNumberDay")
    @ResponseBody
    public TableDataInfo IdSampleNumberDay(IdSampleNumberDay idSampleNumberDay)
    {
        startPage();
        List<IdSampleNumberDay> list = statisticsService.selectIdSampleNumberDayList(idSampleNumberDay);
        return getDataTable(list);
    }

    /**
     * 样本数量统计列表
     */
//    @RequiresPermissions("publish:register:export")
    @Log(title = "样本数量日统计", businessType = BusinessType.EXPORT)
    @PostMapping("/exportIdSampleNumberDay")
    @ResponseBody
    public AjaxResult exportlistIdSampleNumberDay( IdSampleNumberDay idSampleNumberDay)
    {
        List<IdSampleNumberDay> list = statisticsService.selectIdSampleNumberDayList(idSampleNumberDay);
        ExcelUtil<IdSampleNumberDay> util = new ExcelUtil<IdSampleNumberDay>(IdSampleNumberDay.class);
        return util.exportExcel(list, "样本数量日统计");
    }




//    月
    /**
     * 样本数量统计列表
     */
//    @RequiresPermissions("publish:register:view")
    @GetMapping("IdSampleNumberMonth")
    public String IdSampleNumberMonth()
    {
        return prefix + "/IdSampleNumberMonth";
    }

    /**
     * 样本数量统计列表
     */
//    @RequiresPermissions("publish:register:list")
    @PostMapping("/listIdSampleNumberMonth")
    @ResponseBody
    public TableDataInfo listIdSampleNumberMonth( IdSampleNumberMonth idSampleNumberMonth)
    {
        startPage();
        List<IdSampleNumberMonth> list = statisticsService.selectIdSampleNumberMonthList(idSampleNumberMonth);
        return getDataTable(list);
    }


//    @RequiresPermissions("publish:register:list")
    @PostMapping("/listIdSampleNumberMonthAll")
    @ResponseBody
    public TableDataInfo listIdSampleNumberMonthAll( IdSampleNumberMonthAll idSampleNumberMonthAll)
    {
        startPage();
        List<IdSampleNumberMonthAll> list = statisticsService.selectIdSampleNumberMonthListAll(idSampleNumberMonthAll);
        return getDataTable(list);
    }

    /**
     * 样本数量统计列表
     */
//    @RequiresPermissions("publish:register:export")
    @Log(title = "样本数量月统计", businessType = BusinessType.EXPORT)
    @PostMapping("/exportIdSampleNumberMonth")
    @ResponseBody
    public AjaxResult exportlistIdSampleNumberMonth( IdSampleNumberMonth idSampleNumberMonth)
    {
        List<IdSampleNumberMonth> list = statisticsService.selectIdSampleNumberMonthList(idSampleNumberMonth);
        ExcelUtil<IdSampleNumberMonth> util = new ExcelUtil<IdSampleNumberMonth>(IdSampleNumberMonth.class);
        return util.exportExcel(list, "样本数量月统计");
    }

//    年





    /**
     * 样本数量统计列表
     */
//    @RequiresPermissions("publish:register:view")
    @GetMapping("IdSampleNumberYear")
    public String IdSampleNumberYear()
    {
        return prefix + "/IdSampleNumberYear";
    }

    /**
     * 样本数量统计列表
     */
//    @RequiresPermissions("publish:register:list")
    @PostMapping("/listIdSampleNumberYear")
    @ResponseBody
    public TableDataInfo listIdSampleNumberYear(IdSampleNumberYear idSampleNumberYear)
    {
        startPage();
        List<IdSampleNumberYear> list = statisticsService.selecIdSampleNumberYearList(idSampleNumberYear);
        return getDataTable(list);
    }

    /**
     * 样本数量统计列表
     */
//    @RequiresPermissions("publish:register:export")
    @Log(title = "样本数量年统计", businessType = BusinessType.EXPORT)
    @PostMapping("/exportIdSampleNumberYear")
    @ResponseBody
    public AjaxResult exportlistIdSampleNumberYear( IdSampleNumberYear idSampleNumberYear)
    {
        List<IdSampleNumberYear> list = statisticsService.selecIdSampleNumberYearList(idSampleNumberYear);
        ExcelUtil<IdSampleNumberYear> util = new ExcelUtil<IdSampleNumberYear>(IdSampleNumberYear.class);
        return util.exportExcel(list, "样本数量年统计");
    }



//    出版单位统计
    /**
     * 出版单位统计列表
     */
//    @RequiresPermissions("publish:register:view")
    @GetMapping("IdPublishUnitNumber")
    public String IdPublishUnitNumber()
    {
        return prefix + "/IdPublishUnitNumber";
    }

    /**
     * 出版单位统计列表
     */
//    @RequiresPermissions("publish:register:list")
    @PostMapping("/listIdPublishUnitNumber")
    @ResponseBody
    public TableDataInfo listIdPublishUnitNumber(IdPublishUnitNumber idPublishUnitNumber)
    {
        startPage();
        List<IdPublishUnitNumber> list = statisticsService.selectIdPublishUnitNumberList(idPublishUnitNumber);
        return getDataTable(list);
    }

    /**
     * 出版单位统计列表
     */
//    @RequiresPermissions("publish:register:export")
    @Log(title = "出版单位统计", businessType = BusinessType.EXPORT)
    @PostMapping("/exportIdPublishUnitNumber")
    @ResponseBody
    public AjaxResult exportlistIdPublishUnitNumber( IdPublishUnitNumber idPublishUnitNumber)
    {
        List<IdPublishUnitNumber> list = statisticsService.selectIdPublishUnitNumberList(idPublishUnitNumber);
        ExcelUtil<IdPublishUnitNumber> util = new ExcelUtil<IdPublishUnitNumber>(IdPublishUnitNumber.class);
        return util.exportExcel(list, "出版单位统计");
    }



//    执法单位统计
    /**
     * 执法单位统计列表
     */
//    @RequiresPermissions("publish:register:view")
    @GetMapping("IdSendUnitNumber")
    public String IdSendUnitNumber()
    {
        return prefix + "/IdSendUnitNumber";
    }

    /**
     * 执法单位统计列表
     */
//    @RequiresPermissions("publish:register:list")
    @PostMapping("/listIdSendUnitNumber")
    @ResponseBody
    public TableDataInfo listIdSendUnitNumber(IdSendUnitNumber idSendUnitNumber)
    {
        startPage();
        List<IdSendUnitNumber> list = statisticsService.selectIdSendUnitNumberList(idSendUnitNumber);
        return getDataTable(list);
    }

    /**
     * 执法单位统计列表
     */
//    @RequiresPermissions("publish:register:export")
    @Log(title = "执法单位统计", businessType = BusinessType.EXPORT)
    @PostMapping("/exportSendUnitNumber")
    @ResponseBody
    public AjaxResult exportlistSendUnitNumber(IdSendUnitNumber idSendUnitNumber)
    {
        List<IdSendUnitNumber> list = statisticsService.selectIdSendUnitNumberList(idSendUnitNumber);
        ExcelUtil<IdSendUnitNumber> util = new ExcelUtil<IdSendUnitNumber>(IdSendUnitNumber.class);
        return util.exportExcel(list, "执法单位统计");
    }


//    样本类别统计
    /**
     * 样本类别统计列表
     */
//    @RequiresPermissions("publish:register:view")
    @GetMapping("IdSampleTypeNumber")
    public String IdSampleTypeNumber()
    {
        return prefix + "/IdSampleTypeNumber";
    }

    /**
     * 样本类别统计列表
     */
//    @RequiresPermissions("publish:register:list")
    @PostMapping("/listIdSampleTypeNumber")
    @ResponseBody
    public TableDataInfo listIdSampleTypeNumber(IdSampleTypeNumber idSampleTypeNumber)
    {
        startPage();
        List<IdSampleTypeNumber> list = statisticsService.selectIdSampleTypeNumberList(idSampleTypeNumber);
        return getDataTable(list);
    }

    /**
     * 样本类别统计列表
     */
//    @RequiresPermissions("publish:register:export")
    @Log(title = "样本类别统计", businessType = BusinessType.EXPORT)
    @PostMapping("/exportIdSampleTypeNumber")
    @ResponseBody
    public AjaxResult exportlistIdSampleTypeNumber(IdSampleTypeNumber idSampleTypeNumber)
    {
        List<IdSampleTypeNumber> list = statisticsService.selectIdSampleTypeNumberList(idSampleTypeNumber);
        ExcelUtil<IdSampleTypeNumber> util = new ExcelUtil<IdSampleTypeNumber>(IdSampleTypeNumber.class);
        return util.exportExcel(list, "样本类别统计");
    }



}
